#ifndef NODE_H
#define NODE_H

#include <QList>
#include "JavaCC.h"
#include "Token.h"
#include "Object.h"


//All AST nodes must implement this interface.  It provides basic
//machinery for constructing the parent and child relationships
//between nodes.

class PythonGrammar30;
class Node;
typedef QSharedPointer<Node> NodePtr;
class Node: public Object
{
public: 
    public: virtual ~Node() { }
    
    //This method is called after the node has been made the current
    //node.  It indicates that child nodes can now be added to it. */
    virtual void jjtOpen() const = 0;

    //This method is called after all the child nodes have been
    //added.
    virtual void jjtClose() const = 0;

    //This pair of methods are used to inform the node of its
    //parent.
    virtual void jjtSetParent(Node *n) = 0;
    virtual Node *jjtGetParent() const = 0;

    //This method tells the node to add its argument to the node's
    //list of children.
    virtual void jjtAddChild(Node *n, int i) = 0;

    //This method returns a child node.  The children are numbered
    //from zero, left to right.
    virtual NodePtr jjtGetChild(int i) const = 0;

    //Return the number of children the node has.
    virtual int jjtGetNumChildren() const = 0;
    //virtual int getId() const = 0;
    virtual QString type() const {return "Node";}
};


#endif
